.class public Lrexsee/natives/clazz/StringAdapter;
.super Landroid/widget/ArrayAdapter;
.source "StringAdapter.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/ArrayAdapter",
        "<",
        "Ljava/lang/String;",
        ">;"
    }
.end annotation


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mContext:Landroid/content/Context;

.field private final mOptions:[Ljava/lang/String;

.field private final mStyle:Lrexsee/core/style/StyleSheet;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;Lrexsee/core/style/StyleSheet;[Ljava/lang/String;)V
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;
    .param p2, "viewStyle"    # Lrexsee/core/style/StyleSheet;
    .param p3, "options"    # [Ljava/lang/String;

    .prologue
    .line 22
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x1090008

    invoke-direct {p0, v0, v1, p3}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;I[Ljava/lang/Object;)V

    .line 23
    iput-object p1, p0, Lrexsee/natives/clazz/StringAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    .line 24
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lrexsee/natives/clazz/StringAdapter;->mContext:Landroid/content/Context;

    .line 25
    iput-object p2, p0, Lrexsee/natives/clazz/StringAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    .line 26
    iput-object p3, p0, Lrexsee/natives/clazz/StringAdapter;->mOptions:[Ljava/lang/String;

    .line 27
    return-void
.end method


# virtual methods
.method public getDropDownView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5
    .param p1, "position"    # I
    .param p2, "convertView"    # Landroid/view/View;
    .param p3, "parent"    # Landroid/view/ViewGroup;

    .prologue
    const/16 v4, 0x14

    .line 32
    if-nez p2, :cond_0

    .line 33
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mContext:Landroid/content/Context;

    invoke-static {v2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    .line 34
    .local v0, "inflater":Landroid/view/LayoutInflater;
    const v2, 0x1090008

    const/4 v3, 0x0

    invoke-virtual {v0, v2, p3, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p2

    .line 36
    .end local v0    # "inflater":Landroid/view/LayoutInflater;
    :cond_0
    const v2, 0x1020014

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    .line 37
    .local v1, "tv":Landroid/widget/TextView;
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, p0, Lrexsee/natives/clazz/StringAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    invoke-static {v2, v1, v3}, Lrexsee/natives/ViewStyle;->setTextViewStyle(Lrexsee/core/browser/Browser;Landroid/widget/TextView;Lrexsee/core/style/StyleSheet;)V

    .line 38
    invoke-virtual {v1, v4, v4, v4, v4}, Landroid/widget/TextView;->setPadding(IIII)V

    .line 39
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mOptions:[Ljava/lang/String;

    aget-object v2, v2, p1

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 40
    return-object p2
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 4
    .param p1, "position"    # I
    .param p2, "convertView"    # Landroid/view/View;
    .param p3, "parent"    # Landroid/view/ViewGroup;

    .prologue
    .line 45
    if-nez p2, :cond_0

    .line 46
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mContext:Landroid/content/Context;

    invoke-static {v2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    .line 47
    .local v0, "inflater":Landroid/view/LayoutInflater;
    const v2, 0x1090008

    const/4 v3, 0x0

    invoke-virtual {v0, v2, p3, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p2

    .line 49
    .end local v0    # "inflater":Landroid/view/LayoutInflater;
    :cond_0
    const v2, 0x1020014

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    .line 50
    .local v1, "tv":Landroid/widget/TextView;
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, p0, Lrexsee/natives/clazz/StringAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    invoke-static {v2, v1, v3}, Lrexsee/natives/ViewStyle;->setTextViewStyle(Lrexsee/core/browser/Browser;Landroid/widget/TextView;Lrexsee/core/style/StyleSheet;)V

    .line 51
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v2, v2, Lrexsee/core/style/StyleSheet;->label_type:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    const-string v3, ""

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 52
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v2, v2, Lrexsee/core/style/StyleSheet;->label_type:Ljava/lang/String;

    const-string v3, "html"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 53
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mOptions:[Ljava/lang/String;

    aget-object v2, v2, p1

    invoke-static {v2}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 60
    :cond_1
    :goto_0
    return-object p2

    .line 54
    :cond_2
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v2, v2, Lrexsee/core/style/StyleSheet;->label_type:Ljava/lang/String;

    const-string v3, "string"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_3

    .line 55
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mOptions:[Ljava/lang/String;

    aget-object v2, v2, p1

    invoke-static {v2}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;

    move-result-object v2

    invoke-interface {v2}, Landroid/text/Spanned;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0

    .line 57
    :cond_3
    iget-object v2, p0, Lrexsee/natives/clazz/StringAdapter;->mOptions:[Ljava/lang/String;

    aget-object v2, v2, p1

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0
.end method
